package com.jc.order.service.impl;

import com.jc.order.domain.SystemTenant;
import com.jc.order.dto.SystemTenantDTO;
import com.jc.order.mapper.SystemTenantMapper;
import com.jc.order.service.SystemTenantService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Slf4j
@Service
public class SystemTenantServiceImpl implements SystemTenantService {

    @Resource
    private SystemTenantMapper systemTenantMapper;

    @Override
    public SystemTenantDTO queryById(Long id) {
        SystemTenantDTO dto = null;
        SystemTenant entity = systemTenantMapper.selectByPrimaryKey(id);
        if (entity != null) {
            dto = new SystemTenantDTO();
            BeanUtils.copyProperties(entity, dto);
        }
        return dto;
    }
}
